<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			class Dog{
				//arguments.length
				constructor(n,a=1) {
				    this.name=n;
					this.age=a;
				}
				/* constructor(n) {
				    this.name=n;
				} */
				showDog () {
					alert("这条狗的名叫"+this.name+",年龄是"+this.age);
				} 
				bite(n){
					alert(this.name+"咬了"+n+",小伤口");
				}
				toString(){
					return "狗["+this.name+"]";
				}
			}
			class TibetDog extends Dog{
				constructor(n,a){
					super(n,a);
				}
				bite(n){
					alert(this.name+"咬了"+n+",大伤口");
				}
			}
			var d=new Dog("小花花",8);//
			 
			alert(d);
			d.showDog();
			d.bite("小猫");
			alert(">>>>>>>>>>>>>>>>>>>>>");
			var ao=new TibetDog("小黑",11);
			ao.showDog();
			ao.bite("哈士奇");
			alert(ao instanceof Dog);//true?
			
		</script>
	</head>
	<body>
	</body>
</html>
